package com.server.server.message.enums;

import lombok.Getter;

/**
 * @Description: This is a sample class.
 * @Author: Simon
 */
public enum MessageType {
    REQUEST((byte)0),
    RESPONSE((byte)1);

    @Getter
    private final byte type;
    MessageType(byte type){
        this.type=type;
    }

    public static MessageType findByType(byte type) {
        for(MessageType messageType:MessageType.values()){
            if(messageType.getType()==type){
                return messageType;
            }
        }
        return null;
    }
}
